import AVFoundation

func setupAudioSession() {
    let audioSession = AVAudioSession.sharedInstance()
    do {
        try audioSession.setCategory(.playAndRecord, mode: .default)
        try audioSession.setActive(true, options: .notifyOthersOnDeactivation)
    } catch {
        print("音频会话设置失败: \(error)")
    }
}